import json
import pandas as pd



class DataRecorder:

    def __init__(self):
        pass

    async def data_recording(self, data):

        with open('../data/wb.json', 'w') as json_file:
            json.dump(data, json_file,  ensure_ascii=False, indent=4)

        df = pd.read_json('../data/wb.json')

        # CSV
        df.to_csv('../data/wb.csv', encoding='utf-8', index=False)

        # XML
        df.to_xml('../data/wb.xml', encoding='utf-8', index=False)

        # EXEL
        df.to_excel('../data/wb.xlsx', index=False)
